﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kooboo.HtmlFunc
{
    public class AnalysisSetting
    {
        public const string ControlType_Date = "date";
        public const string ControlType_Image = "image";
        public const string ControlType_Textbox = "textbox";
        public const string ControlType_Textarea = "textarea";
        public const string ControlType_Richtext = "richtext";

        static AnalysisSetting()
        {
            SupportControlTypes = new HashSet<string>(StringComparer.CurrentCultureIgnoreCase);
            SupportControlTypes.Add(ControlType_Date);
            SupportControlTypes.Add(ControlType_Image);
            SupportControlTypes.Add(ControlType_Textbox);
            SupportControlTypes.Add(ControlType_Textarea);
            SupportControlTypes.Add(ControlType_Richtext);
        }

        public static HashSet<string> SupportControlTypes
        {
            get;
            private set;
        }

        private static bool _throwAnalysisExceptions = false;
        public static bool ThrowAnalysisExceptions
        {
            get { return _throwAnalysisExceptions; }
            set { _throwAnalysisExceptions = value; }
        }

        private static string _funcFilePath = string.Empty;
        public static string FuncFilePath
        {
            get { return _funcFilePath; }
            set
            {
                if (!System.IO.File.Exists(value))
                    throw new Exception("Can not find the function setting file.");
                _funcFilePath = value;
            }
        }
    }
}
